package com.express.service;

import com.express.bean.User;
import com.express.dao.BaseUserDao;
import com.express.dao.impl.UserDaoMysql;

import java.util.List;
import java.util.Map;

/**
 * @Author: laixiangdong
 * @Date 2020/12/07
 */
public class UserService {
    private static BaseUserDao dao = new UserDaoMysql();

    public static Map<String, Integer> console() {
        return dao.console();
    }

    public static List<User> findAll(boolean limit, int offset, int pageNumber) {
        return dao.findAll(limit, offset, pageNumber);
    }

    public static User findByPhone(String phone) {
        return dao.findByPhone(phone);
    }

    public static Boolean insert(User user) {
        return dao.insert(user);
    }

    public static Boolean update(int id, User newUser) {
        return dao.update(id, newUser);
    }

    public static Boolean delete(int id){
        return dao.delete(id);
    }
}
